import request from '@/utils/request'
import { host } from '@/api/common'
// 获取接口目录树
export function getCase_tree(data) {
  return request({
    url: host + '/api/testcase/api_testcase_tree',
    method: 'post',
    data
  })
}

export function addmenu(data) {
  return request({
    url: host + '/api/testcase/editree',
    method: 'post',
    data
  })
}

// 获取所有测试用例列表
export function getallTestcase() {
  return request({
    url: host + '/api/testcase/all_list',
    method: 'post'
  })
}

// 获取单个目录下测试用例列表
export function getsingleTestcaselist(data) {
  return request({
    url: host + '/api/testcase/list',
    method: 'post',
    data
  })
}

// 获取单个测试用例
export function getsinglecase(data) {
  return request({
    url: host + '/api/testcase/list/singlecase',
    method: 'post',
    data
  })
}

// 删除目录
export function deletepeoject(data) {
  return request({
    url: host + '/api/testcase/testcase_tree/delete',
    method: 'delete',
    data
  })
}

// 删除接口
export function deletecase(data) {
  return request({
    url: host + '/api/testcase/list/del_up',
    method: 'delete',
    data
  })
}

// 删除接口
export function upload_case_detail(data) {
  return request({
    url: host + '/api/testcase/list/del_up',
    method: 'post',
    data
  })
}

// 发送接口请求
export function sendrequest(data) {
  return request({
    url: host + '/api/testcase/send_request',
    method: 'post',
    data
  })
}

// 发送接口请求
export function saverequest(data) {
  return request({
    url: host + '/api/testcase/list/single',
    method: 'post',
    data
  })
}

// 导入postman文件
export function uploadcase(data) {
  return request({
    url: host + '/api/testcase/upload',
    method: 'post',
    data
  })
}

// 复制接口
export function copy_case(data) {
  return request({
    url: host + '/api/testcase/copy_case',
    method: 'post',
    data
  })
}

// 上传参数化列表
export function upload_parametric(data) {
  return request({
    url: host + '/api/testcase/parametric/upload',
    method: 'post',
    data
  })
}

// 删除参数化文件
export function delete_parametric(data) {
  return request({
    url: host + '/api/testcase/parametric/delete_parametric',
    method: 'post',
    data
  })
}

// 获取参数化列表
export function get_parametric(data) {
  return request({
    url: host + '/api/testcase/parametric/get_parametric',
    method: 'post',
    data
  })
}

// 发送接口请求
export function batch_send_request(data) {
  return request({
    url: host + '/api/testcase/parametric/batch_send_request',
    method: 'post',
    data
  })
}

// 获取批量请求结果
export function get_batch_result(data) {
  return request({
    url: host + "/api/testcase/parametric/get_batch_result",
    method: 'post',
    data
  })
}

// 获取批量请求结果
export function get_single_batch_result(data) {
  return request({
    url: host + "/api/testcase/parametric/get_single_batch_result",
    method: 'post',
    data
  })
}

// 编辑参数化列表
export function edit_parametric(data) {
  return request({
    url: host + '/api/testcase/parametric/edit_parametric',
    method: 'post',
    data
  })
}

// curl导入接口
export function curl_input_case(data) {
  return request({
    url: host + '/api/testcase/curl_input',
    method: 'post',
    data
  })
}

// 发送接口请求
export function batch_list_request(data) {
  return request({
    url: host + '/api/testcase/batch_list_request',
    method: 'post',
    data
  })
}

// 多接口批量请求接口添加单个接口
export function batch_get_case(data) {
  return request({
    url: host + '/api/testcase/batch_get_case',
    method: 'post',
    data
  })
}

// 拖拽改变层级
export function change_pid(data) {
  return request({
    url: host + '/api/testcase/change_pid',
    method: 'post',
    data
  })
}

// 接口执行历史
export function api_history_result(data) {
  return request({
    url: host + '/api/testcase/api_result',
    method: 'post',
    data
  })
}
